﻿using System;
using System.ComponentModel;
using System.Reflection;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdPsPlotStyle : OdRxObject
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdPsPlotStyle(IntPtr cPtr, bool cMemoryOwn) : base(GlobalsPINVOKE.OdPsPlotStyle_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdPsPlotStyle obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdPsPlotStyle()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdPsPlotStyle(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		public OdPsPlotStyle() : this(GlobalsPINVOKE.new_OdPsPlotStyle(), MemoryManager.GetMemoryManager().GetCurrentTransaction() == null)
		{
			MemoryTransaction currentTransaction = MemoryManager.GetMemoryManager().GetCurrentTransaction();
			if (currentTransaction != null)
			{
				currentTransaction.AddObject(new OdPsPlotStyle(this.swigCPtr.Handle, true));
			}
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			this.SwigDirectorConnect();
		}

		public new static OdPsPlotStyle cast(OdRxObject pObj)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = GlobalsPINVOKE.OdPsPlotStyle_cast(OdRxObject.getCPtr(pObj));
			OdPsPlotStyle result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdPsPlotStyle)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdPsPlotStyle)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdPsPlotStyle)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new static OdRxClass desc()
		{
			OdRxClass result = (OdRxClass)Teigha.Core.Helpers.odrxCreateObjectInternal(GlobalsPINVOKE.OdPsPlotStyle_desc(), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdRxClass isA()
		{
			OdRxClass result = (OdRxClass)Teigha.Core.Helpers.odrxCreateObjectInternal(this.SwigDerivedClassHasMethod("isA", OdPsPlotStyle.swigMethodTypes1) ? GlobalsPINVOKE.OdPsPlotStyle_isASwigExplicitOdPsPlotStyle(this.swigCPtr) : GlobalsPINVOKE.OdPsPlotStyle_isA(this.swigCPtr), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdRxObject queryX(OdRxClass protocolClass)
		{
			OdRxObject result = Teigha.Core.Helpers.odrxCreateObjectInternal(this.SwigDerivedClassHasMethod("queryX", OdPsPlotStyle.swigMethodTypes0) ? GlobalsPINVOKE.OdPsPlotStyle_queryXSwigExplicitOdPsPlotStyle(this.swigCPtr, OdRxClass.getCPtr(protocolClass)) : GlobalsPINVOKE.OdPsPlotStyle_queryX(this.swigCPtr, OdRxClass.getCPtr(protocolClass)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public static OdPsPlotStyle createObject()
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = GlobalsPINVOKE.OdPsPlotStyle_createObject();
			OdPsPlotStyle result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdPsPlotStyle)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdPsPlotStyle)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdPsPlotStyle)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual string name()
		{
			string result = GlobalsPINVOKE.OdPsPlotStyle_name(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual string description()
		{
			string result = GlobalsPINVOKE.OdPsPlotStyle_description(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void getData(OdPsPlotStyleData data)
		{
			GlobalsPINVOKE.OdPsPlotStyle_getData(this.swigCPtr, OdPsPlotStyleData.getCPtr(data));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual string localizedName()
		{
			string result = GlobalsPINVOKE.OdPsPlotStyle_localizedName(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setData(OdPsPlotStyleData data)
		{
			GlobalsPINVOKE.OdPsPlotStyle_setData(this.swigCPtr, OdPsPlotStyleData.getCPtr(data));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void setDescription(string desc)
		{
			GlobalsPINVOKE.OdPsPlotStyle_setDescription(this.swigCPtr, desc);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void setName(string name)
		{
			GlobalsPINVOKE.OdPsPlotStyle_setName(this.swigCPtr, name);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void setLocalizedName(string name)
		{
			GlobalsPINVOKE.OdPsPlotStyle_setLocalizedName(this.swigCPtr, name);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		private void SwigDirectorConnect()
		{
			if (this.SwigDerivedClassHasMethod("queryX", OdPsPlotStyle.swigMethodTypes0))
			{
				this.swigDelegate0 = new OdPsPlotStyle.SwigDelegateOdPsPlotStyle_0(this.SwigDirectorqueryX);
			}
			if (this.SwigDerivedClassHasMethod("isA", OdPsPlotStyle.swigMethodTypes1))
			{
				this.swigDelegate1 = new OdPsPlotStyle.SwigDelegateOdPsPlotStyle_1(this.SwigDirectorisA);
			}
			if (this.SwigDerivedClassHasMethod("name", OdPsPlotStyle.swigMethodTypes2))
			{
				this.swigDelegate2 = new OdPsPlotStyle.SwigDelegateOdPsPlotStyle_2(this.SwigDirectorname);
			}
			if (this.SwigDerivedClassHasMethod("description", OdPsPlotStyle.swigMethodTypes3))
			{
				this.swigDelegate3 = new OdPsPlotStyle.SwigDelegateOdPsPlotStyle_3(this.SwigDirectordescription);
			}
			if (this.SwigDerivedClassHasMethod("getData", OdPsPlotStyle.swigMethodTypes4))
			{
				this.swigDelegate4 = new OdPsPlotStyle.SwigDelegateOdPsPlotStyle_4(this.SwigDirectorgetData);
			}
			if (this.SwigDerivedClassHasMethod("localizedName", OdPsPlotStyle.swigMethodTypes5))
			{
				this.swigDelegate5 = new OdPsPlotStyle.SwigDelegateOdPsPlotStyle_5(this.SwigDirectorlocalizedName);
			}
			if (this.SwigDerivedClassHasMethod("setData", OdPsPlotStyle.swigMethodTypes6))
			{
				this.swigDelegate6 = new OdPsPlotStyle.SwigDelegateOdPsPlotStyle_6(this.SwigDirectorsetData);
			}
			if (this.SwigDerivedClassHasMethod("setDescription", OdPsPlotStyle.swigMethodTypes7))
			{
				this.swigDelegate7 = new OdPsPlotStyle.SwigDelegateOdPsPlotStyle_7(this.SwigDirectorsetDescription);
			}
			if (this.SwigDerivedClassHasMethod("setName", OdPsPlotStyle.swigMethodTypes8))
			{
				this.swigDelegate8 = new OdPsPlotStyle.SwigDelegateOdPsPlotStyle_8(this.SwigDirectorsetName);
			}
			if (this.SwigDerivedClassHasMethod("setLocalizedName", OdPsPlotStyle.swigMethodTypes9))
			{
				this.swigDelegate9 = new OdPsPlotStyle.SwigDelegateOdPsPlotStyle_9(this.SwigDirectorsetLocalizedName);
			}
			GlobalsPINVOKE.OdPsPlotStyle_director_connect(this.swigCPtr, this.swigDelegate0, this.swigDelegate1, this.swigDelegate2, this.swigDelegate3, this.swigDelegate4, this.swigDelegate5, this.swigDelegate6, this.swigDelegate7, this.swigDelegate8, this.swigDelegate9);
		}

		private bool SwigDerivedClassHasMethod(string methodName, Type[] methodTypes)
		{
			MethodInfo method = base.GetType().GetMethod(methodName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, methodTypes, null);
			return method.DeclaringType.IsSubclassOf(typeof(OdPsPlotStyle));
		}

		private IntPtr SwigDirectorqueryX(IntPtr protocolClass)
		{
			return OdRxObject.getCPtr(this.queryX((OdRxClass)Teigha.Core.Helpers.odrxCreateObjectInternal(protocolClass, false))).Handle;
		}

		private IntPtr SwigDirectorisA()
		{
			return OdRxClass.getCPtr(this.isA()).Handle;
		}

		[return: MarshalAs(UnmanagedType.LPWStr)]
		private string SwigDirectorname()
		{
			return this.name();
		}

		[return: MarshalAs(UnmanagedType.LPWStr)]
		private string SwigDirectordescription()
		{
			return this.description();
		}

		private void SwigDirectorgetData(IntPtr data)
		{
			this.getData(new OdPsPlotStyleData(data, false));
		}

		[return: MarshalAs(UnmanagedType.LPWStr)]
		private string SwigDirectorlocalizedName()
		{
			return this.localizedName();
		}

		private void SwigDirectorsetData(IntPtr data)
		{
			this.setData(new OdPsPlotStyleData(data, false));
		}

		private void SwigDirectorsetDescription([MarshalAs(UnmanagedType.LPWStr)] string desc)
		{
			this.setDescription(desc);
		}

		private void SwigDirectorsetName([MarshalAs(UnmanagedType.LPWStr)] string name)
		{
			this.setName(name);
		}

		private void SwigDirectorsetLocalizedName([MarshalAs(UnmanagedType.LPWStr)] string name)
		{
			this.setLocalizedName(name);
		}

		private object locker = new object();

		private HandleRef swigCPtr;

		private OdPsPlotStyle.SwigDelegateOdPsPlotStyle_0 swigDelegate0;

		private OdPsPlotStyle.SwigDelegateOdPsPlotStyle_1 swigDelegate1;

		private OdPsPlotStyle.SwigDelegateOdPsPlotStyle_2 swigDelegate2;

		private OdPsPlotStyle.SwigDelegateOdPsPlotStyle_3 swigDelegate3;

		private OdPsPlotStyle.SwigDelegateOdPsPlotStyle_4 swigDelegate4;

		private OdPsPlotStyle.SwigDelegateOdPsPlotStyle_5 swigDelegate5;

		private OdPsPlotStyle.SwigDelegateOdPsPlotStyle_6 swigDelegate6;

		private OdPsPlotStyle.SwigDelegateOdPsPlotStyle_7 swigDelegate7;

		private OdPsPlotStyle.SwigDelegateOdPsPlotStyle_8 swigDelegate8;

		private OdPsPlotStyle.SwigDelegateOdPsPlotStyle_9 swigDelegate9;

		private static Type[] swigMethodTypes0 = new Type[]
		{
			typeof(OdRxClass)
		};

		private static Type[] swigMethodTypes1 = new Type[0];

		private static Type[] swigMethodTypes2 = new Type[0];

		private static Type[] swigMethodTypes3 = new Type[0];

		private static Type[] swigMethodTypes4 = new Type[]
		{
			typeof(OdPsPlotStyleData)
		};

		private static Type[] swigMethodTypes5 = new Type[0];

		private static Type[] swigMethodTypes6 = new Type[]
		{
			typeof(OdPsPlotStyleData)
		};

		private static Type[] swigMethodTypes7 = new Type[]
		{
			typeof(string)
		};

		private static Type[] swigMethodTypes8 = new Type[]
		{
			typeof(string)
		};

		private static Type[] swigMethodTypes9 = new Type[]
		{
			typeof(string)
		};

		public delegate IntPtr SwigDelegateOdPsPlotStyle_0(IntPtr protocolClass);

		public delegate IntPtr SwigDelegateOdPsPlotStyle_1();

		[return: MarshalAs(UnmanagedType.LPWStr)]
		public delegate string SwigDelegateOdPsPlotStyle_2();

		[return: MarshalAs(UnmanagedType.LPWStr)]
		public delegate string SwigDelegateOdPsPlotStyle_3();

		public delegate void SwigDelegateOdPsPlotStyle_4(IntPtr data);

		[return: MarshalAs(UnmanagedType.LPWStr)]
		public delegate string SwigDelegateOdPsPlotStyle_5();

		public delegate void SwigDelegateOdPsPlotStyle_6(IntPtr data);

		public delegate void SwigDelegateOdPsPlotStyle_7([MarshalAs(UnmanagedType.LPWStr)] string desc);

		public delegate void SwigDelegateOdPsPlotStyle_8([MarshalAs(UnmanagedType.LPWStr)] string name);

		public delegate void SwigDelegateOdPsPlotStyle_9([MarshalAs(UnmanagedType.LPWStr)] string name);
	}
}
